package cn.itcast.music.ui.mine;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import cn.itcast.music.databinding.FragmentMineBinding;
import cn.itcast.music.ui.history.HistoryActivity;

public class MineFragment extends Fragment {

    private FragmentMineBinding binding;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater,
            ViewGroup container, Bundle savedInstanceState) {
        binding = FragmentMineBinding.inflate(inflater, container, false);

        binding.llHistory.setOnClickListener(view -> {
            Log.d("App-MineFragment", "查看历史记录列表");
            Intent intent = new Intent(requireContext(), HistoryActivity.class);
            requireContext().startActivity(intent);
        });

        return binding.getRoot();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        binding = null;
    }

}
